<%@page contentType="text/html;charset=UTF-8" language="java" import="com.compuvest.web.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<jsp:useBean id="sb" class="MySQL" scope="application"/>
<jsp:useBean id="mail" class="Mail" scope="application"/>
<jsp:useBean id="basket" class="Basket" scope="session"/>
<%
    Customer cust = basket.getCustomer();
    if(cust == null) {
	response.sendRedirect(application.getInitParameter("https") + "CustomerForm.jsp");
	return;
    }

    java.text.SimpleDateFormat dateForm = new java.text.SimpleDateFormat("MM/dd/yyyy HH:mm:ss");

    String mode = request.getParameter("mode");
    if(mode != null) {
	if("Send".equals(mode)) {
	    sb.newReseller(cust, basket.getClickstream().getIPAddress());
	    mail.sendReseller(cust);

	    basket.setCustomer(null);

	    response.sendRedirect(session.getAttribute("backItemsPage") == null ? application.getInitParameter("http") : (String)session.getAttribute("backItemsPage"));
	    return;
	}
	else if("Edit".equals(mode)) {
	    response.sendRedirect(application.getInitParameter("https") + "Reseller.jsp");
	    return;
	}
    }
%>
<html>
<%@include file="/incl/head.html" %>

<body style='background-color:white;'>

<div class='contentstyle'>
<fieldset style="padding:0 0;text-align:center;">
<table>
 <tr>
 <td>
  <div style="background:#F5F5F5;"><img src='../images/hlogo.png'/></div>
  <div class=tit style="text-align:center;">Compuvest Corporation, 3600 Lind Ave. S.W, Suite 130, Renton, WA 98057 USA.</div>
  <div class=tit>&nbsp;&nbsp;Tel: (425) 738-4091</div>
  <div class=tit>&nbsp;&nbsp;Fax: (425)251-5000</div>
  <div class=tit style="text-align:right;"><%= dateForm.format(new java.util.Date()) %>&nbsp;&nbsp;&nbsp;</div>
  <div class=tit>&nbsp;&nbsp;Reseller Certificate # <font color=green><%= cust.getResellerCode() %></font></div>
  <hr/>
 </td>
 </tr>
 <tr>
  <td>
  <div class=tit style="padding:2px 6px;">Reseller Address:<br/>
   <span style="font-weight:normal;">
    <%= cust.getEmail() %><br/>
    <%= cust.billing.getCompany() %><br/>
    <%= cust.billing.getName() %><br/>
    <%= cust.billing.getAddress1() %>
    <%= cust.billing.getAddress2() %>
    <%= cust.billing.getCity() %>,
    <%= cust.billing.getState() %>
    <%= cust.billing.getZip() %>
    <%= cust.billing.getZip4() %>
    <%= cust.billing.getCountry() %><br/>
    Tel: <%= cust.billing.getPhone() %><br/>
    Cell: <%= cust.billing.getCell() %><br/>
    Fax: <%= cust.billing.getFax() %>
   </span>
  </div>
  </td>
 </tr>
 <tr>
  <td>
  <hr/>
  <div class=tit style="font-weight:normal;padding:6px 6px;">
  &nbsp;&nbsp;&nbsp;Thank you for your interest in our reseller program.  Your application has been submitted and will be reviewed
  by one of our account managers.  We will be contacting you within 24 hours if any questions arise and will help you take full
  advantage of this program.  You will also be assigned a designated sales person to work directly with your company - ensuring
  everything is handled smoothly and accurately.
  </div>
  <hr/>
  <div style="text-align:right;">
   <form name="sendForm" action="<%= application.getInitParameter("https") + "ResellerSendForm.jsp" %>" method='POST'>
   <input type='submit' name='mode' value='Edit'>&nbsp;&nbsp;
   <input type='submit' name='mode' value='Send'>&nbsp;&nbsp;
   </form>
  </div>
  </td>
 </tr>
</table>

</fieldset>
</div>

</body>
<%@ include file="./incl/tracking.incl" %>
</html>
